package mementoPattern;

/**
 * 源原发器
 */
public class Editor {

    private String context;

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Editor(String context) {
        this.context = context;
    }

    public Memento createMemento(){
        return new Memento(this.context);
    }

    public void restoreMemento(Memento memento){
        this.context = memento.getContext();
    }
}
